<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib prefix="aa" uri="http://ajaxanywhere.sourceforge.net/" %>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><fmt:message key="vipServiceGiftList.title"/></title> 
<script src="<c:url value='/scripts/common.js'/>"></script>
<script src="<c:url value='/scripts/ajax/aa.js'/>"></script>


<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
</head>

<body leftmargin="0" topmargin="0">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td class="home-content-title"><img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle">礼仪物品准备</td>
  </tr>
</tr>
<tr> 
    <td valign="top"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
      
       
      
      
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                <td class="home-table-tool-content">&nbsp;
		
		
			<html:reset styleClass="home-inputBtn" onclick="doReset()">
           		重置
			</html:reset>
			<input type="button" class="home-inputBtn"  onclick="doSubmit()" value="保存并提交"
			 	<c:if test="${'savesubmit' eq param.method || '2' eq param.type || '3' eq param.type}">disabled</c:if>
			 />		
        		
		</td>
		
              </tr> 
            
              <tr>
                <td align="center" valign="top">
                <aa:zone name="abc">  
               <c:import url="../../../vipServiceSheet.html?method=view&isInclude=yes"> 
               		<c:param name="id" value="${vipServiceGiftForm.vipServiceSheetId}">
                	</c:param>
               </c:import>
               </aa:zone>
               </td>
              </tr>
              <tr>
             <td align="center" valign="top" class="home-edittable-space">	
             
             
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                      <td class="home-table-tool-content">礼仪物品记录</td>
                </tr>	
		<html:form action="vipServiceGift"  >
          <html:hidden property="id"/>
		<table width="100%" border="0" cellspacing="0" cellpadding="4">
					<tr> 
	<input type="button" class="home-table-inputbox" 
	<c:if test="${'savesubmit' eq param.method || '2' eq param.type || '3' eq param.type}">disabled</c:if>
	onclick="MM_openBrWindow('vipServiceGift.html?method=edit&vipServiceSheetId=<c:out value="${vipServiceGiftForm.vipServiceSheetId}"/>','','width=500,height=400')" value="<fmt:message key="button.add"/>"/>
    <input type="button" class="home-table-inputbox" 
    <c:if test="${'savesubmit' eq param.method || '2' eq param.type || '3' eq param.type}">disabled</c:if>
    onclick="doDelete('selected_id')"  value="<fmt:message key="button.delete"/>"/>	 
                  </tr>						
						<tr> 
						<td class="home-tab-list-bg"> 
						<aa:zone name="aaahhh">
							<table width="100%" border="0" cellspacing="1" cellpadding="2" class="home-subtable-bgcolor">
								<tr height=25> 
									<td width="5%"  class="home-table-tool-conten"> <input type="checkbox" name="checkbox" value="checkbox" onclick="chooseAll(this)" /></td>
									<td width="10%" class="home-table-tool-conten">物品类型</td>
									<td width="30%" class="home-table-tool-conten">描述</td>
									<td width="8%" class="home-table-tool-conten">数量</td>
									<td width="8%" class="home-table-tool-conten">费用</td>
									<td width="30%" class="home-table-tool-conten">备注</td>
									<td width="10%" class="home-table-tool-conten">编辑</td>
								</tr>
								  <c:forEach var="results" items="${vipServiceGiftList}" varStatus="status">
								<tr height=25> 
									<td class="home-tab-content"> <input type="checkbox" name="selected_id" value="<c:out value='${results.id}'/>" /></td>
									<td class="home-tab-content"><c:if test="${results.category==1}">鲜花</c:if>
									<c:if test="${results.category==2}">地毯</c:if>
									<c:if test="${results.category==3}">礼品</c:if>
									</td>
									<td class="home-tab-content"><c:out value="${results.flowerDesc}"/></td>
									<td class="home-tab-content"><c:out value="${results.flowerNumber}"/></td>
									<td class="home-tab-content"><c:out value="${results.flowerFee}"/></td>
									<td class="home-tab-content"><c:out value="${results.flowerMemo}"/></td>
									<td class="home-tab-content"><img src="images/update.gif" width="12" onclick="MM_openBrWindow('./vipServiceGift.html?&method=edit&vipServiceSheetId=<c:out value="${param.vipServiceSheetId}"/>&id=<c:out value="${results.id}"/>',null,'top=200,height=400,width=500,status=no,toolbar=no,menubar=no,location=no scrollbars=yes');" style="cursor:hand" height="14" border=0 /></td>
								</tr>
							</c:forEach> 
							</table>
					</aa:zone>
						</td>
						</tr>
					</table>
					</html:form>
                </td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td height="12"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="10">&nbsp;</td>
  </tr>
</table>

</body>
<script>
//written by kellen 07-04-19
function doDelete(chkName){  
		var selected = new Array(); 
		var val = "";	  
		   for (var i=0;i < document.vipServiceGiftForm.elements.length; i++){
				var e = document.vipServiceGiftForm.elements[i];  
				if (e.name==chkName){
				 var chk = document.vipServiceGiftForm.elements[i];
					if(chk.checked){
						var bb = e.value; 
					    	selected.push(bb);
					    	break;
					} 
				}	 
			}	 
 		if(0!=selected.length){
 			if(confirm("<fmt:message key="common.confirm.message"/>")){  
 				var flowParams = "&workItemId=<c:out value="${param.workItemId}"/>&processinstid=<c:out value="${param.processinstid}"/>&appId=<c:out value="${param.appId}"/>&type=1";
				document.vipServiceGiftForm.method="post";
				document.vipServiceGiftForm.action="./vipServiceGift.html?method=delete&vipServiceSheetId=<c:out value="${vipServiceGiftForm.vipServiceSheetId}"/>"+flowParams;
				document.vipServiceGiftForm.submit();
			}else return;	  			
		}else{
			alert("<fmt:message key="common.delete.message"/>");
		}	 
	}
	
	function doSubmit(){
		vipServiceGiftForm.method="post";
		vipServiceGiftForm.action="vipServiceGift.html?method=savesubmit&processinstid=<c:out value="${param.processinstid}"/>&workItemId=<c:out value="${param.workItemId}"/>&appId=<c:out value="${param.appId}"/>&vipServiceSheetId=<c:out value="${param.vipServiceSheetId}"/>";
		vipServiceGiftForm.submit();
	}
</script>

<script> 
	function aaa(){ 
	ajaxAnywhere.getZonesToReload = function() {
    return "aaahhh";
	}
	 ajaxAnywhere.getAJAX('./vipServiceGift.html?vipServiceSheetId=<c:out value="${vipServiceGiftForm.vipServiceSheetId}"/>','aaahhh')
     //ajaxAnywhere.submitAJAX(); 
	}
	
	
	
</script>
</html> 